using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace DataAccess
{
    public enum p_APPTOKEN_FIELD
    {
        APPTOKEN,
		TOKEN,
		APPLNO,
		APPLNAME,
		EMPNO,
		PASSWORD,
		CRDATE,
		LANG,
		FUNCTION_GROUP,
		DIVISION,
		COMPANY_CODE,
		FUNCNO
    }

    public class p_APPTOKEN : AbstractProperty
    {
        private OPERATOR CONDITION = OPERATOR.AND; //AND = Default
        private string string_criteria = "";
        private List<Hashtable> hashtable_criteria = new List<Hashtable>();
        private int cal_criteria = 0;

        public double APPTOKEN { get; set; }
		public string TOKEN { get; set; }
		public string APPLNO { get; set; }
		public string APPLNAME { get; set; }
		public string EMPNO { get; set; }
		public string PASSWORD { get; set; }
		public DateTime CRDATE { get; set; }
		public string LANG { get; set; }
		public string FUNCTION_GROUP { get; set; }
		public string DIVISION { get; set; }
		public string COMPANY_CODE { get; set; }
		public string FUNCNO { get; set; }

        public override string getStringCriteria()
        {
            return string_criteria.ToLower().Replace("where", "");
        }

        public override List<Hashtable> getHashtableCriteria()
        {
            return hashtable_criteria;
        }

        public override void setCriteria(string cmd)
        {
            this.string_criteria = cmd;
        }

        public override void setCriteria(Enum column_name, CRITERIA_FLAG cf, object Value)
        {
            cal_criteria++;
            Hashtable h = new Hashtable();
            h.Add(column_name.ToString() + cf.GetDescription().Replace("{val}", ":cri_" + cal_criteria.ToString() + column_name.ToString()), ":cri_" + cal_criteria.ToString() + column_name.ToString() + "๐" + Value);
            this.hashtable_criteria.Add(h);
        }

        public override void clearCriteria()
        {
            cal_criteria = 0;
            this.string_criteria = "";
            this.hashtable_criteria.Clear();
        }

        public override string getOperator()
        {
            return this.CONDITION.ToString();
        }

        public override void setOperator(OPERATOR obj)
        {
            this.CONDITION = obj;
        }
    }
}
